﻿using UnityEngine;
using ZCUtil.Algorithm;

namespace ZCTouchDrawBoard
{
    /// <summary>
    /// 纸张的撤销队列
    /// </summary>
    class ZCPaperQueue : BaseQueue<BasePaperView>
    {
        #region PublicMethod
        public ZCPaperQueue(int size) : base(size) { }
        #endregion

        #region ProtectedMethod 创建和拷贝
        protected override void CreateCurrent(BasePaperView t)
        {
            m_Arrays[m_Tail] = new AlphaPaperView();
            m_Arrays[m_Tail].Initialize(t.Width, t.Height);
        }

        protected override void CopyCurrent(BasePaperView t)
        {
            Graphics.CopyTexture(t.RenderTexture, GetCurrent().RenderTexture);
        }
        #endregion
    }
}
